/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package MessageHandler;

/**
 *
 * @author maniksin
 */
public enum messages {
    HELLO_PACKET(0),    // exchanged b/w peers
    PEER_COMMAND(1),    // Command received from peer
    PEER_REPLY(2),      // Reply received from peer
    USER_COMMAND(3),    // User command to be forwarded to peer
    USER_REPLY(4);
    
    
    public int msg_id;
    messages(int msg_id) {
        this.msg_id = msg_id;
    }
    
    public static messages find_enum(int type) {
        switch(type) {
            case 0: return HELLO_PACKET;
            case 1: return PEER_COMMAND;
            case 2: return PEER_REPLY;
            case 3: return USER_COMMAND;
            case 4: return USER_REPLY;
            default: return null;
        }
    }
}
